package com.springboot.strategy.demo003.api.controller;

import com.springboot.strategy.demo003.pay.PayStrategyContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class PayController {

    @Autowired
    private PayStrategyContext payStrategyContext;


    @GetMapping("/pay")
    public String pay(String payCode){
        return payStrategyContext.getStrategy(payCode).pay();
    }
}
